package com.kaifamiao.month05.day19;

public class Demo {

    public static void main(String[] args) {
        String str = "7 # 6 $ 5 # 12".replace(" ","");
        int sIndex = str.indexOf("$");
        for (int i = 0; i < sIndex; i ++) {
            char c = str.charAt(i);
            if (!Character.isDigit(c)) {
                int left = Integer.parseInt(str.substring(i + 1, sIndex));
                System.out.println(left);
            }
        }
    }
}
